-
Notifications
You must be signed in to change notification settings - Fork 183
feat(tools): Add think tool with option to disable it. #1346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1346 +/- ##
=======================================
Coverage 16.75% 16.75%
=======================================
Files 213 213
Lines 20704 20704
Branches 871 871
=======================================
Hits 3468 3468
Misses 17236 17236 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Just a couple minor changes - and sorry can you rebase main and push again? |
Sure. |
Issue #, if available:
Description of changes:
Testing
With tool enabled
-q settings chat.enableThinking true
with tool disabled
-q settings chat.enableThinking false
Add Think Tool with Configurable Enablement
Description
This PR introduces a new "Think" tool that enhances Amazon Q's reasoning capabilities during chat interactions. The Think tool provides a dedicated space for the model to process information, navigate
complex decision trees, and improve response quality in multi-step scenarios.
Key Features
• Added a new think.rs module implementing the Think tool functionality
• Integrated the tool into the existing tools framework
• Made the feature configurable via settings (q settings enable_thinking [true|false])
• Added conditional tool registration based on the feature flag
• Implemented blue-colored visual feedback when the model shares its reasoning process
Implementation Details
• The Think tool allows the model to explicitly reason through complex problems during response generation
• When enabled, the tool displays the model's thought process in blue text
• The feature is enabled by default but can be disabled via settings
• Empty thoughts are accepted but ignored to maintain robustness
• The tool is completely excluded from the available tools list when disabled
Technical Changes
• Added new file: crates/q_cli/src/cli/chat/tools/think.rs (86 lines)
• Modified tool registration in load_tools() to conditionally include the Think tool
• Updated tool index JSON to include the Think tool definition
• Added tool handling in the Tool enum and related functions
• Implemented validation, invocation, and description methods for the tool
Usage
Users can control this feature with:
q settings enable_thinking true # Enable the thinking feature (default)
q settings enable_thinking false # Disable the thinking feature
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.